<% layout('/layouts/default.html', {title: '考生选择', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-body">
			<#form:form id="searchForm" model="${smStudent}" action="${ctx}/sm/smStudent/listData" method="post" class="form-inline"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">姓名：</label>
					<div class="control-inline">
						<#form:input path="name" maxlength="100" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">所属驾校：</label>
					<div class="control-inline width-120" >
						<#form:treeselect id="officeId" title="部门"
							path="officeId" labelPath=""
							url="${ctx}/sys/office/treeData" allowClear="true"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">报名时间：</label>
					<div class="control-inline">
						<#form:input path="signupTime" readonly="true" maxlength="20" class="form-control Wdate-datetime"
							dataFormat="datetime" onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',isShowClear:false});"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">受理人：</label>
					<div class="control-inline width-120" >
						<#form:treeselect id="employeeId" title="用户"
							path="employeeId" labelPath=""
							url="${ctx}/sys/office/treeData?isLoadUser=true" allowClear="true"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">查询</button>
					<button type="reset" class="btn btn-default btn-sm">重置</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
var selectData = null, selectNum = 0,
    dataGrid = $('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
        {header:'id', name:'id', index:'a.id', width:150, align:"center",hidden:true},
		{header:'证件号', name:'idno', index:'a.idno', width:150, align:"left", frozen:true},
		{header:'姓名', name:'name', index:'a.name', width:150, align:"left"},
		{header:'性别', name:'sex', index:'a.sex', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('sys_user_sex')}, val, '未知', true);
		}},
		{header:'出生日期', name:'birthDate', index:'a.birth_date', width:150, align:"center"},
		{header:'籍贯', name:'nativePlace', index:'a.native_place', width:150, align:"left"},
		{header:'户口所在地', name:'regPlace', index:'a.reg_place', width:150, align:"left"},
		{header:'住址', name:'address', index:'a.address', width:150, align:"left"},
		{header:'联系电话', name:'telephone', index:'a.telephone', width:150, align:"left"},
        {header:'是否VIP', name:'isVip', index:'a.isVip', width:150, align:"left"},
		{header:'所属驾校', name:'school.officeName', index:'a.office_id', width:150, align:"center"},
        {header:'驾校负责人', name:'school.leader', index:'a.leader', width:150, align:"center"},
		{header:'报名时间', name:'signupTime', index:'a.signup_time', width:150, align:"center"},
		{header:'受理人', name:'acceptor.empName', index:'a.employee_id', width:150, align:"center"}
	],onSelectRow: function(id, isSelect, event){
	    selectData=[];
	    selectData.push(dataGrid.dataGrid('getRowData', id));
    },ondblClickRow: function(id, rownum, colnum, event){
		selectData=[];
		selectData.push(dataGrid.dataGrid('getRowData', id));
		$(parent.layer.$.find('.fa-check')[0]).trigger('click');
	}
});
function getSelectData(){
    return selectData;
}
</script>